<template>
  <view class="box">
    <view class="item" v-for="(item, index) in list" @click="toDetail(item)">
      {{ item.title }}
    </view>
    <!-- <view class="inp" v-if="isInp">
				 <u--input
				    placeholder="我也来写一写"
				    border="none"
				    v-model="value"
					@confirm="confirm"
				  ></u--input>
		</view> -->

    <view class="empty_view" v-if="list && list.length == 0">
      <image
        class="item_left_clickable"
        src="../../static/images/my/kong.png"
        mode=""
      ></image>
      <view>暂时还没有相关信息~</view>
    </view>

    <u-modal
      :show="show"
      :title="'提示'"
      :content="'您还不是行者身份，无法参与共创若想要参与共创需要开通行者身份！'"
      :showCancelButton="true"
      confirmText="去开通"
      cancelText="取消"
      confirmColor="#55B877"
      @confirm="submit"
      @cancel="show = false"
    ></u-modal>
  </view>
</template>

<script>
export default {
  props: {
    isInp: {
      type: Boolean,
      default: true,
    },
    list: {
      type: Array,
      default: () => {
        return [];
      },
    },
  },
  data() {
    return {
      // list:[{
      // 	name:'第一章 太空的奇妙'
      // },{
      // 	name:'第二章  准备，前往太空'
      // },{
      // 	name:'第三章  出发，向太空出发'
      // },{
      // 	name:'第四章  冲破大气层'
      // },{
      // 	name:'第五章  脱离地球引力'
      // },{
      // 	name:'第六章  向更远探索'
      // }],
      value: "",
      show: false,
    };
  },
  methods: {
    toDetail(item) {
      if (this.isInp) {
        uni.navigateTo({
          url: `/pages/detail/coCreateFly?id=${item.id}`,
        });
      } else {
        uni.navigateTo({
          url: `/pages/home/coCreateDetail?id=${item.id}`,
        });
      }
    },
    confirm() {
      console.log("eeeeee");
      if (this.isInp) {
        this.show = true;
      }
    },
    submit() {
      uni.navigateTo({
        url: "/pages/member/index",
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.box {
  width: 100%;

  .item {
    margin-top: 40rpx;
    font-size: 30rpx;
    font-family: PingFang SC-Medium, PingFang SC;
    font-weight: 400;
    color: #444444;
  }
  .inp {
    margin-top: 40rpx;
    height: 88rpx;
    background: #f4f4f4;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    display: flex;
    align-items: center;
    padding: 0 32rpx;
  }
}
.empty_view {
  margin-top: 300rpx;
  image {
    margin: 0 auto;
    width: 410rpx;
    height: 410rpx;
  }
  view {
    font-size: 30rpx;
    color: #d8d8d8;
    text-align: center;
  }
}
</style>